const o = Object.create({ x: 1, y: 2 });
o.z = 3;

let { x, ...newObj } = o;
let { y, z } = newObj;
console.log(o);//3
console.log(x); // 1
console.log(y); // undefined
z // 3


let a = { x: 3, z: 2 }
let aWithDefaults = Object.assign({ x: 1, y: 2 }, a);
console.log(aWithDefaults);

let mySymbol = Symbol();

// 第一种写法
// let a1 = {};
// a1[mySymbol] = 'Hello!';

// 第二种写法
let a1 = {
    [mySymbol]: 'Hello!'//但是属性名不能直接写Symbol()
};
console.log(a1, '---a1');



let a2 = new Set([1, 2, 3]);
let b = new Set([4, 3, 2]);
// 交集
let intersect = new Set([...a2].filter(x => b.has(x)));
// set {2, 3}

// （a 相对于 b 的）差集
let difference = new Set([...a2].filter(x => !b.has(x)));
// Set {1}
